package com.yanqu.xiuxian.crosssystem.manger.elementalbonds.entity;

import com.yanqu.xiuxian.db.MongoData;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@Document(collection = "elemental_bonds_group_data")
public class ElementalBondsGroupData extends MongoData {
    private long groupId;
    private List<Long> serverIdList = new ArrayList<>();
    private boolean isFull = false;
    private long createTime;
    private long rewardTime;
    private int round;

    public ElementalBondsGroupData() {
    }

    public ElementalBondsGroupData(int round, long groupId, List<Long> serverIdList, boolean isFull, long createTime) {
        this.serverIdList = serverIdList;
        this.groupId = groupId;
        this.isFull = isFull;
        this.createTime = createTime;
        this.round = round;
        setChangeState();
    }

    public long getGroupId() {
        return groupId;
    }

    public void setGroupId(long groupId) {
        if (!Objects.equals(this.groupId, groupId)) {
            this.groupId = groupId;
            setChangeState();
        }
    }

    public List<Long> getServerIdList() {
        return serverIdList;
    }

    public void setServerIdList(List<Long> serverIdList) {
        if (!Objects.equals(this.serverIdList, serverIdList)) {
            this.serverIdList = serverIdList;
            setChangeState();
        }
    }

    public boolean isFull() {
        return isFull;
    }

    public void setFull(boolean full) {
        isFull = full;
        setChangeState();
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        if (!Objects.equals(this.createTime, createTime)) {
            this.createTime = createTime;
            setChangeState();
        }
    }

    public long getRewardTime() {
        return rewardTime;
    }

    public void setRewardTime(long rewardTime) {
        if (!Objects.equals(this.rewardTime, rewardTime)) {
            this.rewardTime = rewardTime;
            setChangeState();
        }
    }

    public int getRound() {
        return round;
    }

    public void setRound(int round) {
        if (!Objects.equals(this.round, round)) {
            this.round = round;
            setChangeState();
        }
    }
}
